//
//  PKMainViewController.m
//  pantaKills
//
//  Created by 湛凯杰 on 16/8/3.
//  Copyright © 2016年 湛凯杰. All rights reserved.
//

#import "PKMainViewController.h"
#import "PKFriendViewController.h"
#import "PKMoreViewController.h"
#import "PKNewsViewController.h"
#import "PKQuizViewController.h"
#import "PKbasisNavigationController.h"
@interface PKMainViewController (){
    PKMoreViewController  * moreVC;
    PKNewsViewController  * newsVC;
    PKQuizViewController  * quizVC;
    PKFriendViewController * friendVC;
}
@end

@implementation PKMainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.viewControllers = [self setViewControllers];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}
-(NSArray*)setViewControllers{
    NSMutableArray * arrayofcontroller =[NSMutableArray array];
    moreVC =[PKMoreViewController new];
    newsVC =[PKNewsViewController new];
    quizVC =[PKQuizViewController new];
    friendVC=[PKFriendViewController  new];
    moreVC.tabBarItem.title=@"发现";
    newsVC.tabBarItem.title=@"资讯";
    quizVC.tabBarItem.title=@"我";
    friendVC.tabBarItem.title=@"好友";
    moreVC.tabBarItem.image=[UIImage imageNamed:@"tab_icon_more_normal"];
    newsVC.tabBarItem.image=[UIImage imageNamed:@"tab_icon_news_normal"];
    quizVC.tabBarItem.image=[UIImage imageNamed:@"tab_icon_quiz_normal"];
    friendVC.tabBarItem.image=[UIImage imageNamed:@"tab_icon_friend_normal"];
    moreVC.tabBarItem.selectedImage=[UIImage imageNamed:@"tab_icon_more_press"];
    newsVC.tabBarItem.selectedImage=[UIImage imageNamed:@"tab_icon_news_press"];
    quizVC.tabBarItem.selectedImage=[UIImage imageNamed:@"tab_icon_quiz_press"];
    friendVC.tabBarItem.selectedImage=[UIImage imageNamed:@"tab_icon_friend_press"];
    PKbasisNavigationController *moreNAV =[[PKbasisNavigationController alloc]initWithRootViewController:moreVC];
    moreNAV.title=@"发现";
    moreNAV.navigationBar.tintColor=[UIColor whiteColor];
    PKbasisNavigationController *newsNAV =[[PKbasisNavigationController alloc]initWithRootViewController:newsVC];
    newsNAV.navigationBar.tintColor=[UIColor whiteColor];
    PKbasisNavigationController *quizNAV =[[PKbasisNavigationController alloc]initWithRootViewController:quizVC];
    quizNAV.navigationBar.tintColor=[UIColor whiteColor];
    PKbasisNavigationController *friendNAV =[[PKbasisNavigationController alloc]initWithRootViewController:friendVC];
    friendNAV.navigationBar.tintColor=[UIColor whiteColor];
    
    [arrayofcontroller addObject:newsNAV];
    [arrayofcontroller addObject:friendNAV];
    [arrayofcontroller addObject:moreNAV];
    [arrayofcontroller addObject:quizNAV];
    
    return arrayofcontroller;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
